package com.g5.edu.service.impl;

import com.g5.edu.model.DfStudyFile;
import com.g5.edu.mapper.DfStudyFileMapper;
import com.g5.edu.service.IDfStudyFileService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author admin
 * @since 2021-10-29
 */
@Slf4j
@Service
public class DfStudyFileServiceImpl extends ServiceImpl<DfStudyFileMapper, DfStudyFile> implements IDfStudyFileService {

    @Autowired(required = false)
    private DfStudyFileMapper dfStudyFileMapper;

    @Override
    public List<DfStudyFile> getDfStudyFile() {
        List<DfStudyFile> dfStudyFiles = dfStudyFileMapper.selectList(null);
        return dfStudyFiles;
    }

    @Override
    public PageInfo<DfStudyFile> getDfStudyFile(Integer pageNum, Integer pageSize) {
        log.info("传过来的参数是--:" + pageNum + pageSize);
        PageHelper.startPage(pageNum,pageSize);

        List<DfStudyFile> list = dfStudyFileMapper.selectList(null);
        log.info("查询出来的条数是--:" + list.size());

        return new PageInfo<>(list);
    }
}
